<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%--
  Created by IntelliJ IDEA.
  User: Lenovo
  Date: 2021/7/30
  Time: 18:59
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>查询商品界面</title>
    <link href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
    <link rel="stylesheet" href="https://www.layuicdn.com/layui-v2.6.8/css/layui.css"  media="all">
</head>

<body>
<div class="container">
    <div class="row clearfix">
        <div class="col-md-12 column">
            <div class="page-header">
                <h1>
                    <small>DEEP.SPACE商家管理---商品查询</small>
                    <a href="${pageContext.request.contextPath}/Product/allProduct" class="btn btn-danger" style="margin-left: 55%">返回</a>
                </h1>
            </div>
        </div>
    </div>
    <div >
    <div class="row">
        <div class="col-md-4 column">
            <span class="glyphicon glyphicon-folder-open"></span>
            <a class="btn btn-primary" href="${pageContext.request.contextPath}/Product/toAddProduct">新增</a>
        </div>
    </div>
        <div class="row" >
        <div class="col-md-4 column">
            <form action="${pageContext.request.contextPath}/Product/query" method="post">
                <span class="glyphicon glyphicon-search"></span>
                <input type="text" placeholder="请输入商品编号" name="pid" >
                <button type="submit" class="btn btn-default" style="color: brown" >搜索</button>
            </form>
        </div>
    </div>
    </div>
</div>
<div class="row clearfix">
    <div class="col-md-12 column">

        <table class="table table-hover table-striped">
            <thead>
            <tr>
                <th>商品编号</th>
                <th>商品名字</th>
                <th>商品数量</th>
                <th>商品销售量</th>
                <th>商品颜色</th>
                <th>商品图片</th>
                <th>商品价格</th>
            </tr>
            </thead>
            <tbody>
                <tr>
                    <td>${product.getPid()}</td>
                    <td>${product.getPname()}</td>
                    <td>${product.getPnum()}</td>
                    <td>${product.getPsold()}</td>
                    <td>${product.getPcolor()}</td>
                    <td><img src=/imgs/${product.getPimg()} width="100" height="100"></td>
                    <td>${product.getPmoney()}</td>
                    <td>
                        <a href="${pageContext.request.contextPath}/Product/toUpdateProduct?id=${product.getPid()}" style="color: crimson">更改</a> |
                        <a href="${pageContext.request.contextPath}/Product/del/${product.getPid()}" style="color: crimson">删除</a>
                    </td>
                </tr>

            </tbody>
        </table>
    </div>
</div>


</div>
</body>
</html>